package com.kgc.onlineLife.service;

import com.kgc.onlineLife.bean.Category;
import com.kgc.onlineLife.bean.Product;
import com.kgc.onlineLife.bean.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created On : 2022/4/15.
 * <p>
 * Author     : 张冲
 * <p>
 * Description: productsService
 */

public interface ProductsService {
    List<Product> getProductsByCid(int cid);

    Product getProductsById(Integer id);

    /**
     * 通过商品bid查用户
     * @param bid
     * @return
     */
    User getUserByBid(Integer bid);

    Category getCategoryByCid(Integer cid);

    /**
     * 搜索,模糊查询
     * @param searchName
     * @return
     */
    List<Product> selectProductDetailBySearchName(String searchName);

    /**
     * 根据名称模糊查询条数
     * @return
     */
    int selectTotalBySearchName(String searchName);

    /**
     * 根据分类查各个分类的条数
     */
    int selectCategoryTotalByCid(Integer cid);

    Product selectProductById(@Param("id") Integer id);

}
